Skip to content

Spork: unfork Blockly #214

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 82 commits into
base: develop
Choose a base branch
from
Draft

Spork: unfork Blockly #214

wants to merge 82 commits into from

Conversation

cwillisf
Copy link
Contributor

@cwillisf cwillisf commented Mar 5, 2025

Proposed Changes

Use the new version of scratch-blocks, which now depends on Blockly instead of being a fork of Blockly.

Reason for Changes

As stated in scratchfoundation/scratch-blocks#3338:

We can use new Blockly features!
We can more easily maintain scratch-blocks!
We can keep up to date with new Blockly releases!
We can hang with the cool kids at Blockly-related parties!

Test Coverage

Many existing tests at least partially cover these changes. We'll also be testing these changes through several manual testing sessions.

gonfunko and others added 30 commits February 19, 2025 16:25
* fix: run stacks in response to stack click events

* refactor: listen for regular click events to run block stacks
* fix: handle modern workspace comment events

* fix: correctly access coordinates on events
* chore: format runtime.js

* fix: add the hat extension to extension hat blocks
… occupied by a shadow block (#8)

* chore: format engine/blocks.js

* fix: restore shadow blocks when removing a block from an input
The playgrounds themselves are still broken, but it's a step...
* fix: add support for Scratch-style procedures

* refactor: remove underscore procedure creation callback
Copy link

github-actions bot commented Mar 5, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 4 committers have signed the CLA.
✅ (cwillisf)[https://github.com/cwillisf]
@gonfunko
@adroitwhiz
@BeksOmega
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@cwillisf cwillisf force-pushed the spork branch 2 times, most recently from ed3ba88 to 97bf00d Compare March 6, 2025 16:12
@cwillisf
Copy link
Contributor Author

cwillisf commented Apr 1, 2025

Status update for anyone who might be watching this PR:

I know it looks like not much is happening here, but gears are turning behind the scenes. We're working on testing, and I'm sure there will be things to fix before we merge this, but I believe we're getting close. If anyone in the community wants to try this branch, please comment here if you find problems! Other than the zoom icons -- we know about that one 😆

Thank you!

If all goes as planned, I'd like to merge this sometime this summer, specifically before North American schools get going again for fall terms. If we get lucky and it's even earlier, that's cool too!

Some of our friends at Google haven't signed the CLA, but that's OK for now. We're working through some paperwork, but we're all friends, and I'm not worried about it. It's just slow; I apologize for that.

@Samq64
Copy link

Samq64 commented Apr 1, 2025

On scratch-gui's spork-test branch custom block inputs get cleared when editing the definition (gonfunko/scratch-blocks#228).

@mxmou
Copy link

mxmou commented Apr 14, 2025

If anyone in the community wants to try this branch, please comment here if you find problems!

If you make the following script and then click the green flag, nothing happens:
message1

Switching to another sprite and then back to the first fixes it. This seems to happen because the VM receives a var_delete event for the message1 broadcast when a broadcast block is dragged onto the workspace. I wasn't able to find the exact cause of this, but it's related to potential variables.

Another issue is that the isLocal property of variables gets reset to false when switching sprites, which causes Scratch to think variable names conflict when they don't. To reproduce:

  1. Make a project with two sprites.
  2. In the first sprite, make a variable for this sprite only named "a".
  3. In the second sprite, make a variable for this sprite only named "b".
  4. Switch to the first sprite and back to the second.
  5. Rename "b" to "a".

An error message will appear saying that "a" already exists, even though it's in another sprite. This doesn't happen if step 4 is omitted.

There are also some UI bugs:

  • Up & down arrows don't work in context menus and dropdowns.
  • Scrolling in long dropdowns (for example the "switch costume" dropdown if the sprite has many costumes) doesn't work very well. I can use the scrollbar and mouse wheel, but when I move the mouse after scrolling, it scrolls to the bottom instead of staying where it was.
  • The lines on the direction picker are white instead of black in high contrast mode, which makes them hard to see:
    high_contrast_direction_picker

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants